package gen

import (
	"fmt"
	"github.com/scott-go/protoc-gen-code-generator/gen/gin"
	"github.com/scott-go/protoc-gen-code-generator/gen/kit"
	"google.golang.org/protobuf/compiler/protogen"
)

const (

	//  生成文件类型
	GINType   = "gin"
	GOKITType = "go-kit"
)

func GenerateFile(gType string, gen *protogen.Plugin, file *protogen.File) {
	// 如果proto文件中没有定义Service
	if len(file.Services) == 0 {
		fmt.Printf("没有可以实现的Service\n")
	}
	switch gType {
	case GINType:
		gin.GenerateGin(gen, file)
	case GOKITType:
		kit.GenerateGoKit(gen, file)
	default:
		fmt.Printf("不支持的生成类型：%s \n", gType)
	}

}
